package o;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.text.TextUtils;

public class foy {
    private static int ˋ;
    private static String ˎ;

    public static boolean ˊ(Context context) {
        PackageInfo ˎ = ˎ(context);
        if (ˎ == null) {
            return true;
        }
        String str = ˎ.versionName;
        int i = ˎ.versionCode;
        String ˏ = fpc.ˏ(context, "hw_skinner", "LAST_VERSION_NAME", null);
        int ˊ = fpc.ˊ(context, "hw_skinner", "LAST_VERSION_CODE", -1);
        if (str.equals(ˏ) && i == ˊ) {
            return false;
        }
        ˎ = str;
        ˋ = i;
        return true;
    }

    public static void ˏ(Context context) {
        if (!TextUtils.isEmpty(ˎ) && ˋ != 0) {
            fpc.ॱ(context, "hw_skinner", "LAST_VERSION_NAME", ˎ);
            fpc.ˏ(context, "hw_skinner", "LAST_VERSION_CODE", ˋ);
        }
    }

    private static PackageInfo ˎ(Context context) {
        PackageInfo packageInfo = null;
        try {
            packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 16384);
        } catch (Exception e) {
            fmq.ˎ("Get package info error.");
        }
        return packageInfo;
    }
}
